<template>
  <view class="reply-view">
    <view class="reply-title">
      <block>
        <view
          class="reply-name"
          @tap="
            () =>
              handleReply({
                reply_user_id: comment.comment_user_id,
                reply_user_name: comment.comment_user_name
              })
          "
        >
          {{ comment.comment_user_name }}
        </view>
      </block>
      <block v-if="comment.to_user_id">
        回复
        <view
          class="reply-name"
          @tap="
            () =>
              handleReply({
                reply_user_id: comment.to_user_id,
                reply_user_name: comment.to_user_name
              })
          "
        >
          {{ comment.to_user_name }}
        </view>
      </block>
      <block>: {{ comment.content }}</block>
    </view>
  </view>
</template>

<script>
export default {
  name: '',
  props: {
    comment: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {}
  },
  computed: {},
  methods: {
    handleReply(userId) {
      this.$emit('reply', userId)
    }
  }
}
</script>

<style>
.reply-title {
  font-size: 28rpx;
  color: #333;
}
.reply-name {
  display: inline-block;
  font-size: 28rpx;
  color: #006cff;
}
.reply-view {
  padding: 0.2rem 0;
}
.dis-img {
  width: 100%;
  height: 100%;
}
</style>
